package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelPicActivity;
import flc.ast.databinding.FragmentEditBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link EditFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class EditFragment extends BaseNoModelFragment<FragmentEditBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_edit;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);
        mDataBinding.ivPicText.setOnClickListener(this);
        mDataBinding.ivPicRotate.setOnClickListener(this);
        mDataBinding.ivPicCut.setOnClickListener(this);
        mDataBinding.ivPicSticker.setOnClickListener(this);
        mDataBinding.ivPicGraffiti.setOnClickListener(this);
        mDataBinding.ivPicAdjust.setOnClickListener(this);
        mDataBinding.ivPicMosaic.setOnClickListener(this);
        mDataBinding.ivPicFilter.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivPicText://文字
                SelPicActivity.type = 2;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicRotate://旋转
                SelPicActivity.type = 3;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicCut://裁剪
                SelPicActivity.type = 4;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicSticker://贴纸
                SelPicActivity.type = 0;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicGraffiti://涂鸦
                SelPicActivity.type = 5;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicAdjust://色调
                SelPicActivity.type = 6;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicMosaic://马赛克
                SelPicActivity.type = 7;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivPicFilter://滤镜
                SelPicActivity.type = 8;
                SelPicActivity.isMore = false;
                startActivity(SelPicActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}